package com.bsj.sipgateway.web.controller;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.bsj.power.common.config.global.JsonResult;
import com.bsj.power.common.def.dto.alarmReport.AlarmReportSearchDTO;
import com.bsj.power.common.def.dto.video.FaultRecordDTO;
import com.bsj.power.common.def.entity.alarmReport.AlarmReport;
import com.bsj.power.common.def.vo.pls.AlarmReportCountVO;
import com.bsj.sipgateway.web.service.IAlarmService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Description 报警信息管理
 * @Author zhaoyang
 * @Date 2024/5/6 19:31
 */
@RestController
@RequestMapping("/alarm")
//@SaCheckPermission("/video/api/fault")
public class AlarmController {

    @Autowired
    @Qualifier("alarmServiceImpl")
    private IAlarmService alarmService;


    /**
     * 设备故障记录
     *
     * @param faultRecordDTO
     * @return
     */
    @PostMapping("/faultRecord")
    public JsonResult faultRecord(@RequestBody FaultRecordDTO faultRecordDTO) {
        List<AlarmReport> alarmReports = alarmService.faultRecord(faultRecordDTO);
        JsonResult jsonResult = new JsonResult();
        jsonResult.setCode(200);
        jsonResult.setMsg("成功");
        jsonResult.setData(alarmReports);
        return jsonResult;
    }

}
